import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from "@/views/LoginView.vue";
import IndexView from "@/views/IndexView.vue";
import HomeView from "@/views/HomeView.vue";
import NewsView from "@/views/NewsView.vue";

Vue.use(VueRouter)

const routes = [
  {
    path: "/",
    name: "login",
    component:LoginView
  },
  {
    path: 'index',
    name: "index",
    component: IndexView,
    children:[
      {
        path:'/home',
        name:'home',
        component: HomeView
      },
      {
        path: '/news',
        name: 'news',
        component: NewsView
      }

    ]

  },
]

const router = new VueRouter({
  routes
})

export default router
